﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ClientMasterPage.master" AutoEventWireup="true" CodeFile="StepDetails.aspx.cs" Inherits="Consulta_StepDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../Print/Print.css" rel="stylesheet" type="text/css" media="print" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <h1 class="title">
        <asp:Label runat="server" Text="<%$ Resources: StepDetails, TramiteTitle %>"></asp:Label>
    </h1>

    <asp:HyperLink runat="server" ID="Back"
        NavigateUrl="<%$ Resources: MasterPage, MenuZonaClientesUrl %>"
        Text="<%$ Resources: StepDetails, Volver %>">
    </asp:HyperLink>
    <asp:HyperLink runat="server" ID="Print"
        NavigateUrl="#"
        Text="<%$ Resources: StepDetails, Imprimir %>">
    </asp:HyperLink>

    <asp:Panel runat="server" ID="ErrorAlert" Visible="false" style="margin: 10px 0px 10px 0px">
        <div class="ui-state-error ui-corner-all" style="margin-top: 20px; padding: 10px .7em;">
            <div>
            <span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
                <asp:Literal ID="MensajeError" runat="server"
                    Text="<%$ Resources: StepDetails, ErrorTramite %>">
                </asp:Literal>
            </div>
        </div>
    </asp:Panel>

    <asp:PlaceHolder runat="server" ID="detalleTramite">
        <table width="855" class="detalleTramite">
            <col width="285" />
            <col width="285" />
            <col width="285" />
            <tbody>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, CodigoTramite %>"></asp:Label>&nbsp;
                        <asp:Literal ID="CodigoTramite" runat="server"></asp:Literal>
                    </td>
                    <td>
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, TipoTramite %>"></asp:Label>&nbsp;
                        <asp:Literal ID="TipoTramite" runat="server"></asp:Literal>
                    </td>
                    <td>
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, EstadoTramite %>"></asp:Label>&nbsp;
                        <asp:Literal ID="EstadoTramite" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, FechaInicio %>"></asp:Label>&nbsp;
                        <asp:Literal ID="FechaInicio" runat="server"></asp:Literal>
                    </td>
                    <td>
                        <asp:Label ID="LabelFechaFinalizacion" runat="server" Text="<%$ Resources: StepDetails, FechaFinalizacion %>"></asp:Label>&nbsp;
                        <asp:Literal ID="FechaFinalizacion" runat="server"></asp:Literal>
                    </td>
                    <td>
                        <asp:Label ID="LabelFechaEntrega" runat="server" Text="<%$ Resources: StepDetails, FechaEntrega %>"></asp:Label>&nbsp;
                        <asp:Literal ID="FechaEntrega" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, Responsables %>"></asp:Label>&nbsp;
                        <asp:Literal ID="Responsables" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, Clientes %>"></asp:Label>&nbsp;
                        <asp:Literal ID="Clientes" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, Observacion %>"></asp:Label><br />
                        <asp:TextBox runat="server" ID="Observacion"
                            TextMode="MultiLine" ReadOnly="true"
                            Width="850px" style="max-width: 850px; min-width:850px; min-height:50px;">
                        </asp:TextBox>
                    </td>
                </tr>
                <asp:PlaceHolder runat="server" ID="DatosEntrega">
                <tr>
                    <td colspan="3">
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, EntregadoA %>"></asp:Label>&nbsp;
                        <asp:Literal ID="EntregadoA" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:Label runat="server" Text="<%$ Resources: StepDetails, ObservacionEntrega %>"></asp:Label><br />
                        <asp:TextBox runat="server" ID="ObservacionEntrega"
                            TextMode="MultiLine" ReadOnly="true"
                            Width="850px" style="max-width: 850px; min-width:850px; min-height:50px;">
                        </asp:TextBox>
                    </td>
                </tr>
                </asp:PlaceHolder>
            </tbody>
        </table>
        <div style="width:855px; margin: 0 auto">
            <asp:Label Font-Bold="true" runat="server" Text="<%$ Resources: StepDetails, ActividadesTramite %>"></asp:Label>
        </div>
        
        <div id="containerDataTable">
            <asp:GridView ID="ActividadGridView" runat="server"
                    AutoGenerateColumns="false"
                    Width="855px"
                    CssClass="dataTable"
                    GridLines="None"
                    AllowPaging="true"
                    RowStyle-CssClass="item0"
                    AlternatingRowStyle-CssClass="item1"
                    HeaderStyle-CssClass="header"
                    DataSourceID="ActividadesDataSource">
                <Columns>
                    <asp:BoundField HeaderText="N" DataField="RowNumber" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField HeaderText="<%$ Resources: StepDetails, FechaActividad %>" DataField="FechaForDisplay"
                        ControlStyle-Width="70px"  />
                    <asp:BoundField HeaderText="<%$ Resources: StepDetails, DescripcionActividad %>" DataField="Descripcion"/>
                </Columns>
                <EmptyDataTemplate>
                    <div style="text-align:center">
                        <asp:Literal runat="server" Text="<%$ Resources: StepDetails, NoActividades %>"></asp:Literal>
                    </div>
                </EmptyDataTemplate>
            </asp:GridView>
        </div>
    </asp:PlaceHolder>

    <asp:ObjectDataSource ID="ActividadesDataSource" runat="server"
        TypeName="Cuba.Consulta.CRN.ConsultaCRN"
        SelectMethod="GetActividadesByServicioId" 
        OnSelected="ActividadesDataSource_Selected">
        <SelectParameters>
            <asp:ControlParameter ControlID="TramiteIdHiddenField" DefaultValue="0"
                PropertyName="Value" Type="Int32" Name="servicioId" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <asp:HiddenField ID="TramiteIdHiddenField" runat="server" />

    <script type="text/javascript">
        $(document).ready(function () {
            $("#<%= Back.ClientID %>").button({
                icons: {
                    primary: "ui-icon-arrowthick-1-w"
                }
            });
            $("#<%= Print.ClientID %>").button({
                icons: {
                    primary: "ui-icon-print"
                }
            });
            $("#<%= Print.ClientID %>").click(function (e) {
                e.preventDefault();
                window.print();
                return false;
            });
            var html = $("#<%= ActividadGridView.ClientID %> .header").html();
            $("#<%= ActividadGridView.ClientID %> .header").remove();
            $("#<%= ActividadGridView.ClientID %>").prepend("<thead><tr class='header'>" + html + "</tr></thead>");
        });
    </script>
    
</asp:Content>

